﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Xf.MvcTag.Enums
{
    public class EnumHelper
    {
        public static string GetDisplay<T>(T t)
        {
            return (typeof(T).GetMembers().First(m => m.Name == t.ToString()).GetCustomAttributes().First() as DisplayAttribute).Name;
        }
    }
}
